#pragma once

#include "IMathInterface.h"

class CClassFactory : public IClassFactory
{
public:
	CClassFactory(void);
	~CClassFactory(void);
	virtual HRESULT __stdcall	QueryInterface(const IID& riid, void **ppvObject);
	virtual ULONG __stdcall		AddRef();
	virtual ULONG __stdcall		Release();
	virtual HRESULT __stdcall	CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject);
	virtual HRESULT __stdcall	LockServer(BOOL bLock);

	static BOOL					CheckCanUnload(){return CClassFactory::m_cServerlock > 0?FALSE:TRUE;}
private:
	static unsigned long	m_cServerlock;
	unsigned long			m_cRef;
};

